//
//  CWMenu.h
//  CWDevelop
//
//  Created by LittoCats on 7/26/14.
//  Copyright (c) 2014 Littocats. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CWMenu : NSObject
/**
 *  @params :
 {
    focus: 0,
    menus: [{
        title: "title",
        image: "image.png"
    }, {
        title: "title",
        image: "image.png"
    }]
 }
 */
+ (void)popMenu:(NSDictionary *)menus
         inView:(UIView *)view
       fromRect:(CGRect)rect
itemSelectedHandler:(void (^)(NSDictionary *menuData,
                              NSInteger menuIndex))handler;

+ (void) showMenuInView:(UIView *)view
               fromRect:(CGRect)rect
              menuItems:(NSArray *)menuItems;

+ (void) dismissMenu;

+ (UIColor *) tintColor;
+ (void) setTintColor: (UIColor *) tintColor;

+ (UIFont *) titleFont;
+ (void) setTitleFont: (UIFont *) titleFont;

@end


@interface CWMenuItem : NSObject

@property (readwrite, nonatomic, strong) UIImage *image;
@property (readwrite, nonatomic, strong) NSString *title;
@property (readwrite, nonatomic, weak) id target;
@property (readwrite, nonatomic) SEL action;
@property (readwrite, nonatomic, strong) UIColor *foreColor;
@property (readwrite, nonatomic) NSTextAlignment alignment;

+ (instancetype) menuItem:(NSString *) title
                    image:(UIImage *) image
                   target:(id)target
                   action:(SEL) action;

@end